<style scoped>
  .weui-media-box_appmsg .weui-media-box__hd {
    font-size: 12px;
    /*background: #ccc;*/
    color: #fff;
  }
  .weui-media-box_appmsg .weui-media-box__hd .blue {
    background: #296BCC !important;
  }
  .weui-media-box__desc {
    font-size: 12px;
  }
  .weui-media-box__title {
    white-space: normal;
    font-size: 14px;
    margin-bottom: 5px;
  }
  .weui-form-preview__bd {
    text-align: left;
  }

  .weui-form-preview {
    position: relative;
    background-color: #fff;
    margin: 1%;
    border-radius: 5px;
  }
  .time {
    position: absolute;
    right: 15px;
    top: 0;
    font-size: 10px;
    color: #ccc;
  }

  .logimg {
    width: 14px;
    height: 14px;
  }
  .datalist {
    background: #e3e3e3;
    height: 100%;
    overflow: hidden;
  }
  .datalist.nodata {
    font-size: 14px;
    padding: 5px;
  }
  .tit {
    font-size: 12px;
    text-align: left;
    padding: 5px 15px 0 30px;
  }

  .weui-media-box_appmsg {
    /*display: block !important;*/
    font-size: 0;
  }
  .weui-media-box_appmsg .weui-media-box__hd {
    margin-right: 5% !important;
    width: 12%;
    height: 23%;
    white-space: nowrap;
    /*line-height: 23%;*/
    display: inline-block !important;
  }
  .weui-media-box_appmsg .weui-media-box__bd {
    display: inline-block !important;
    width: 71%;
  }
  .weui-media-box__desc {
    overflow: initial;
    line-height: 1.4;
    display: flex;
  }
  .weui-media-box_appmsg .weui-media-box__hd .nodenm{
    width: 40px;
    height: 40px;
    line-height: normal;
    border-radius: 50%;
    background: #ccc;
    margin: 0 auto;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .weui-media-box {
    padding: 0 !important;
  }

  .delsty {
    position: absolute;
    top: -10px;
    right: -15px;
    /*z-index: 1000;*/
  }
  .icontbox {
    font-size: 0;
    width: 95%;
  }
  .contbox-txt {
    font-size: 10px; color: #ccc;
    text-align: right;
  }


  .weui_uploader_input_wrp {
    float: left;
    position: relative;
    margin-right: 9px;
    margin-bottom: 9px;
    width: 77px;
    height: 77px;
    border: 1px solid #D9D9D9;
  }

  .weui_uploader_files {
    list-style: none;
  }

  .weui_uploader_input_wrp:before {
    width: 2px;
    height: 39.5px;
  }

  .weui_uploader_input_wrp:before, .weui_uploader_input_wrp:after {
    content: " ";
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background-color: #D9D9D9;
  }

  .weui_uploader_input {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  .weui_uploader_input_wrp:after {
    width: 39.5px;
    height: 2px;
  }

  .weui_uploader_bd {
    overflow: hidden;
  }
  .outstore >>> .weui-uploader_file {
    float: left;
    margin-right: 9px;
    margin-bottom: 9px;
    width: 79px;
    background: no-repeat 50%;
    background-size: cover;
  }

  .weui-cell.fir {
    border-top: 0;
  }
  .weui_uploader_input_wrp.inrow {
    width: 30px;
    height: 30px;
    margin: 0;
  }

  .weui_uploader_input_wrp:before {
    height: 19.5px;
  }

  .weui_uploader_input_wrp:after {
    width: 19.5px;
  }

  .weui-uploader_file.inrow {
    margin: 0;
    width: 40px;
  }

  li.weui-uploader_file {
    display: inline-block;
    padding: 3px 5px;
  }

  ul#images {
    text-align: right;
  }
  .weui-loadmore_line .weui-loadmore__tips {
    background: none;
  }
  .muti1 .weui-form-preview__bd {
    margin-left: 20px;
  }
  .min-btn {
    font-size: 10px;color: #000;background: #ccc; margin-left: 3px;
    padding: 1px 2px;
  }
</style>
<template>
  <div class="logs">
    <p class="tit" v-show="nodes.length > 0">审批记录</p>
    <div style="overflow:auto;overflow-x: hidden;margin-bottom: 50px;" v-show="nodes.length > 0" id="wrap">
      <div class="weui-form-preview" v-for="(item, index) in nodes">
        <template v-if="isArray(item)">
          <div class="weui-form-preview muti1">
            <div class="weui-form-preview__bd">
              <template v-if="item.length > 1">
                <div class="weui-cells">
                  <div class="weui-cell weui-cell_swiped">
                    <div class="weui-cell__bd" style="transform: translate3d(0px, 0px, 0px);">
                      <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
                        <template v-for="(item2, index2) in item">
                          <template v-if="isArray(item2)">

                            <!--                                  <div class="weui-cells" style="margin-top: 60px;">-->
                            <div class="weui-cells">
                              <div class="weui-cell weui-cell_swiped">
                                <div class="weui-cell__bd" style="transform: translate3d(0px, 0px, 0px);">
                                  <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
                                    <template v-for="(item3, index3) in item2">
                                      <template v-if="isArray(item3)">

                                      </template>
                                      <template v-else>
                                        <div class="weui-media-box__hd anode" style="overflow: hidden;">
                                          <div class="nodenm" @click="openNode(item3)" :class="item3.status != 1 ? 'blue' : ''">{{item3.name}}</div>
                                        </div>
                                      </template>
                                    </template>
                                  </a>
                                </div>
                                <div class="weui-cell__ft ahnode">
                                  <!--                <a class="weui-swiped-btn weui-swiped-btn_warn delete-swipeout" href="javascript:">删除</a>-->
                                  <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
                                    <div class="weui-media-box__hd" style="overflow: hidden;">
                                      <div class="nodenm"  :class="currNode.status != 1 ? 'blue' : ''">{{currNode.name}}</div>
                                    </div>
                                    <div class="weui-media-box__bd" style="position: relative;">
                                      <div class="icontbox">
                                        <h4 class="weui-media-box__title contbox-h4">{{(itemOperators(currNode.operators).length > 0 ? itemOperators(currNode.operators)[0] : {}).realname}}</h4>
                                        <!--                                              <h4 class="weui-media-box__title contbox-h4" v-if="itemOperators(currNode.operators).length <= 1" v-for="(oper, i) in itemOperators(currNode.operators)">{{oper.realname}}</h4>-->
                                        <!--                                              <h4 class="weui-media-box__title contbox-h4" v-if="itemOperators(currNode.operators).length > 1"><span v-for="(oper2, i) in itemOperators(currNode.operators)">{{oper2.realname}}<i v-show="i+1 != itemOperators(currNode.operators).length"> / </i></span></h4>-->
                                        <p class="contbox-txt">{{filterNull(currNode.logs).createtime}}</p>
                                      </div>
                                      <p class="weui-media-box__desc">{{filterNull(currNode.logs).description}}</p>
                                      <div class="exp uploaderFiles" style="display: inline-block;padding-top: 5px;" v-if="currNode.logs != null && getImgType(currNode.logs.imgs).length > 0">
                                        <img class="logimg" style="padding-right: 5px;"  v-for="(image, index) in getImgType(currNode.logs.imgs)" :key="image.guid"  alt="" onerror="javascript:this.src='../../../static/image/default.png';this.onerror = null" :src="image.url + '-suolue.png'" :data-img="image.url + '.png'" />
                                      </div>
                                    </div>
                                  </a>
                                  <a class="weui-swiped-btn weui-swiped-btn_default close-swipeout" href="javascript:">关闭</a>
                                </div>
                              </div>
                            </div>
                          </template>
                          <template v-else>
                            <div class="weui-media-box__hd anode" style="overflow: hidden;">
                              <div class="nodenm" @click="openNode(item2)" :class="!item2.status ? 'blue' : ''">{{item2.name}}</div>
                            </div>
                          </template>
                        </template>
                      </a>
                    </div>
                    <div class="weui-cell__ft ahnode">
                      <!--                <a class="weui-swiped-btn weui-swiped-btn_warn delete-swipeout" href="javascript:">删除</a>-->
                      <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
                        <div class="weui-media-box__hd" style="overflow: hidden;">
                          <div class="nodenm"  :class="!currNode.status ? 'blue' : ''">{{currNode.name}}</div>
                        </div>
                        <div class="weui-media-box__bd" style="position: relative;">
                          <p class="time">{{filterNull(currNode.logs).createTime}}</p>
                          <h4 class="weui-media-box__title" v-if="currNode.operators && currNode.operators.length <= 1" v-for="(oper, i) in currNode.operators">{{oper.nickName}}</h4>
                          <h4 class="weui-media-box__title" v-if="currNode.operators && currNode.operators.length > 1"><span v-for="(oper2, i) in currNode.operators">{{oper2.nickName}}<i v-show="i+1 != currNode.operators.length"> | </i></span></h4>
                          <p class="weui-media-box__desc">{{filterNull(currNode.logs).description}}</p>
                          <div class="exp uploaderFiles" v-if="currNode.logs && filterNull(currNode.logs).files.length > 0" style="display: flex;align-items: center; padding-top: 5px;background: #fafafa;padding: 3px;">
                            <template v-for="(image, index) in filterNull(currNode.logs).files">
                              <img v-if="image.typeFile == 1" class="logimg" style="padding-right: 5px;" :key="image.id"  alt="" onerror="javascript:this.src='../../../static/image/default.png';this.onerror = null" :src="'/prod-api' + image.urlSuolu" :data-img="'/prod-api' + image.url" />
                              <span v-else @click="downFile(image.url)" style="display: inline-block; padding-right: 10px;color: #0066CC;font-size: 12px;">{{image.fileName}}</span>
                            </template>
                          </div>
                        </div>
                      </a>
                      <a class="weui-swiped-btn weui-swiped-btn_default close-swipeout" href="javascript:">关闭</a>
                    </div>
                  </div>
                </div>
              </template>
              <template v-else>
                <template v-for="(item2, index2) in item">
                  <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
                    <div class="weui-media-box__hd" style="overflow: hidden;">
                      <div class="nodenm"  :class="!item2.status ? 'blue' : ''">
<!--                        {{item2.name}}-->
                        <img src="../../assets/icon-user3.png" width="24" />
                      </div>
                    </div>
                    <div class="weui-media-box__bd" style="position: relative;">
                      <p class="time">{{filterNull(item2.logs).createTime}}</p>
                      <h4 class="weui-media-box__title" style="font-weight: 600;color: #999;">{{item2.name}}</h4>
                      <div class="weui-media-box__desc" style="display: block;">
                        <h4 class="weui-media-box__title" style="display: inline;color:#333;" v-if="item2.operators && item2.operators.length <= 1" v-for="(oper, i) in item2.operators">{{oper.nickName}}</h4>
                        <h4 class="weui-media-box__title" style="display: inline;color:#333;" v-if="item2.operators && item2.operators.length > 1"><span v-for="(oper2, i) in item2.operators">{{oper2.nickName}}<i v-show="i+1 != item2.operators.length"> | </i></span></h4>
                        <span style="margin-left: 10px;">{{filterNull(item2.logs).description}}</span>
                      </div>
<!--                      <h4 class="weui-media-box__title" v-if="item2.operators && item2.operators.length <= 1" v-for="(oper, i) in item2.operators">{{oper.nickName}}</h4>-->
<!--                      <h4 class="weui-media-box__title" v-if="item2.operators && item2.operators.length > 1"><span v-for="(oper2, i) in item2.operators">{{oper2.nickName}}<i v-show="i+1 != item2.operators.length"> | </i></span></h4>-->
<!--                      <p class="weui-media-box__desc">{{filterNull(item2.logs).description}}</p>-->
                      <div class="exp uploaderFiles" v-if="item2.logs && filterNull(item2.logs).files.length > 0" style="display: flex;align-items: center; padding-top: 5px;background: #fafafa;padding: 3px;">
                        <template v-for="(image, index) in filterNull(item2.logs).files">
                          <img v-if="image.typeFile == 1" class="logimg" style="padding-right: 5px;" :key="image.id"  alt="" onerror="javascript:this.src='../../../static/image/default.png';this.onerror = null" :src="'/prod-api' + image.urlSuolu" :data-img="'/prod-api' + image.url" />
                          <span v-else @click="downFile(image.url)" style="display: inline-block; padding-right: 10px;color: #0066CC;font-size: 12px;">{{image.fileName}}</span>
                        </template>
                      </div>
                    </div>
                  </a>
                </template>
              </template>

              <!--                  </template>-->
              <!--                </template>-->
            </div>
          </div>
        </template>
        <template v-else>
          <div class="weui-form-preview__bd">
            <a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
              <div class="weui-media-box__hd" style="overflow: hidden;">
                <div class="nodenm"  :class="!item.status ? 'blue' : ''">
                  <img src="../../assets/icon-user3.png" width="24" />
<!--                  <div style="width: 80%;white-space: initial;">{{item.name}}</div>-->
                </div>
              </div>
              <div class="weui-media-box__bd" style="position: relative;">
                <template v-if="filterNull(item.logs).flag == 3">
                  <p class="time">{{filterNull(item.logs).createTime}}</p>
                  <h4 class="weui-media-box__title" style="font-weight: 600;color: #999;">抄送</h4>
                  <div class="weui-media-box__desc" style="display: block;">
<!--                    <span class="weui-media-box__title" style="color:#333;" v-if="item.logs.ccOperators && item.logs.ccOperators.length <= 1" v-for="(oper, i) in item.operators">{{oper.nickName}}</span>-->
<!--                    <span class="weui-media-box__title" style="color:#333;" v-if="item.logs.ccOperators && item.logs.ccOperators.length > 1"><span v-for="(oper2, i) in item.operators">{{oper2.nickName}}<i v-show="i+1 != item.operators.length"> | </i></span></span>-->
                    <span class="weui-media-box__title" style="color:#333;">{{item.logs.ccOperators}}</span>
                  </div>
                </template>
                <template v-else>
                  <p class="time">{{filterNull(item.logs).createTime}}</p>
                  <h4 class="weui-media-box__title" style="font-weight: 600;color: #999;">
                    {{item.name}}
                    <div v-if="filterNull(item.logs).flag == 4" style="display: inline-block;margin-left: 5px;font-size: 12px;padding: 0 6px;background: #eee;color: #999;font-weight: normal;">转交</div>
                    <div v-if="filterNull(item.logs).flag == 2" style="display: inline-block;margin-left: 5px;font-size: 12px;padding: 0 6px;background: #eee;color: #999;font-weight: normal;">拒绝</div>
                  </h4>
                  <div v-if="item.status == 1" class="weui-media-box__desc" style="display: block;">
                    <template v-if="filterNull(item.logs).flag == 5">
                      <template v-if="filterNull(item.logs).status == 1">
                        <span style="color:#333;margin-right: 5px;">{{filterNull(item.logs).operator}}</span>  {{filterNull(item.logs).description}}
                        <span v-if="userid == filterNull(item.logs).createBy" @click="pullback(filterNull(item.logs).id, 'node')" class="min-btn">撤回</span>
                      </template>
                      <template v-else>
                        <div style="font-size: 12px; color: #999;overflow: auto;">
                          <span style="color:#006699;">{{filterNull(item.logs).operator}}：</span>
                          <span style="display: inline-block;line-height: 18px;">已于 {{filterNull(item.logs).cancelDate}} 撤回评论</span>
                        </div>
                      </template>
                    </template>
                    <template v-else>
                      <span style="color:#333;margin-right: 5px;">{{filterNull(item.logs).operator}}</span>  {{filterNull(item.logs).description}}
                    </template>
                  </div>
                  <div v-else class="weui-media-box__desc" style="display: block;">
                    <span class="weui-media-box__title" style="color:#333;" v-if="item.operators && item.operators.length <= 1" v-for="(oper, i) in item.operators">{{oper.nickName}}</span>
                    <span class="weui-media-box__title" style="color:#333;" v-if="item.operators && item.operators.length > 1"><span v-for="(oper2, i) in item.operators">{{oper2.nickName}}<i v-show="i+1 != item.operators.length"> | </i></span></span>
                    <span style="margin-left: 10px;">{{filterNull(item.logs).description}}</span>
                  </div>
                  <div class="exp uploaderFiles" v-if="item.logs && filterNull(item.logs).files.length > 0" style="display: flex;align-items: center; padding-top: 5px;background: #fafafa;padding: 3px;">
                    <template v-for="(image, index) in filterNull(item.logs).files">
                      <img v-if="image.typeFile == 1" class="logimg" style="padding-right: 5px;" :key="image.id"  alt="" onerror="javascript:this.src='../../../static/image/default.png';this.onerror = null" :src="'/prod-api' + image.urlSuolu" :data-img="'/prod-api' + image.url" />
                      <span v-else @click="downFile(image.url)" style="display: inline-block; padding-right: 10px;color: #0066CC;font-size: 12px;">{{image.fileName}}</span>
                    </template>
                  </div>
                </template>
              </div>
            </a>
          </div>
        </template>
      </div>
      <div class="weui-loadmore weui-loadmore_line">
        <span class="weui-loadmore__tips">没有更多了</span>
      </div>
    </div>
    <div class="weui-loadmore" v-if="loading">
      <i class="weui-loading"></i>
      <span class="weui-loadmore__tips">正在加载</span>
    </div>
    <div v-show="!loading && nodes.length <= 0" class="datalist nodata" v-else>没有审批记录哦~</div>
  </div>
</template>

<script>
  import wx from 'weixin-js-sdk'
  import OperationLogs from '../common/OperationLogs'
  import VuePipeline from 'vue-pipeline'

  export default {
    name: 'SalesOperationLogs7',
    data () {
      return {
        nodes: [],
        nodesHtml: '',
        userid: localStorage.userId,
        matchedRmrks: [],
        loading: true,
        wxParams: {},
        images2: {
          serverId: [],
          srcStr: [],
        },
        tempnode: '',
        pendNodes: [],
        currPullId: '',
        showPullbackModal: false
      }
    },
    props: [
      'orderid',
      'srguid',
      'departid',
      'sellformpcode',
      'nodeid',
      'flowid'
    ],
    components: {
      OperationLogs,
      VuePipeline
    },
    mounted() {
      $('#wrap').on('click', '.logimg', function () {
        let num = $(this).parent().children().length;
        let imgArr = [];
        for (var i=0; i<num; i++) {
          if ($(this).parent().find('.logimg').eq(i).data('img')) {
            imgArr.push($(this).parent().find('.logimg').eq(i).data('img'));
          }
        }
        let index = $(this).index();
        let pb2 = $.photoBrowser({
          items: imgArr,
          initIndex: index
        });
        pb2.open();
      });

    },
    watch: {
      'orderid': function (val) {
        this.getOperatelogs();
      },
    },
    methods: {
      pullback(id, type = '') {
        this.showPullbackModal = true;
        this.currPullId = id;
        // if (type == 'node') {
          this.currPullPath = `/prod-api/flow/operationlogs/cancelComment?id=${this.currPullId}`;
        // } else {
        //   this.currPullPath = `/prod-api/flow/optlog/cancelReply/${this.currPullId}`;
        // }
        let that = this;
        $.confirm('确定要撤回？', function () {
          that.axios({
            method: 'post',
            url: that.currPullPath
          }).then(async response => {
            let data = response.data;
            if(data.code == 200){
              await that.getOperatelogs();
            }else{
              that.toastText('撤回失败');
            }
          }).catch(function (error) {
            that.toastError('系统错误');
          });
        })
      },
      downFile(url) {
        location.href = '/prod-api' + url;
      },
      getOperatelogs: function (id) {
        // this.nodes = [{"id":1,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"发起","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5137,"operators":[{"userId":55,"nickName":"13600000008","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5137,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":55,"updateBy":null,"createTime":"2022-04-24 18:22:46","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"发起","description":"发起","nodeId":1,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"13600000008","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":2,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"部门主管审批","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5138,"operators":[{"userId":55,"nickName":"13600000008","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5138,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":55,"updateBy":null,"createTime":"2022-04-25 11:32:30","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"部门主管审批","description":"同意","nodeId":2,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"13600000008","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":3,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"总监审批","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5139,"operators":[{"userId":55,"nickName":"13600000008","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5139,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":55,"updateBy":null,"createTime":"2022-04-25 11:34:31","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"总监审批","description":"同意","nodeId":3,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"13600000008","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":4,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"供应链会计审批","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5141,"operators":[{"userId":55,"nickName":"13600000008","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5141,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":55,"updateBy":null,"createTime":"2022-04-25 11:41:59","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"供应链会计审批","description":"同意","nodeId":4,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"13600000008","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":5,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"入库","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5170,"operators":[{"userId":55,"nickName":"13600000008","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5170,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":55,"updateBy":null,"createTime":"2022-04-27 14:21:24","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"入库","description":"同意","nodeId":5,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"13600000008","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":7,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"退回库房","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5171,"operators":[{"userId":18,"nickName":"穆管理","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5171,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":18,"updateBy":null,"createTime":"2022-04-27 17:20:29","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"退回库房","description":"阿斯顿发放","nodeId":7,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"穆管理","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":7,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"退回库房","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5172,"operators":[{"userId":18,"nickName":"穆管理","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5172,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":18,"updateBy":null,"createTime":"2022-04-27 17:21:04","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"退回库房","description":"退回库房","nodeId":7,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"穆管理","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":7,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":1,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":null,"name":"退回库房","msgTempId":null,"operate":null,"permission":null,"flowNextStat":null,"flowStat":null,"repeatFlag":null,"sort":null,"annex":null,"nodeType":null,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":null,"approvalType":null,"branchiids":null,"isTransmit":null,"optlogid":5175,"operators":[{"userId":55,"nickName":"13600000008","openid":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":{"id":5175,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":55,"updateBy":null,"createTime":"2022-04-27 18:08:14","updateTime":null,"remark":null,"businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"orderId":203,"operation":"退回库房","description":"meiyou","nodeId":7,"flag":1,"flowTempId":26,"flowTaskId":null,"orderCode":"PF220439","flowName":"采购订单","logs":[],"files":[],"operator":"13600000008","ccOperators":null,"className":"FlowOperation"},"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},[{"id":8,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":"反入库","businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":26,"name":"反入库","msgTempId":null,"operate":"backOut26","permission":4,"flowNextStat":40,"flowStat":80,"repeatFlag":1,"sort":40,"annex":null,"nodeType":3,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":5,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":"评论","approvalType":1,"branchiids":null,"isTransmit":null,"optlogid":null,"operators":[{"userId":7,"nickName":"张福","openid":"oIuV2v77MaLCAQILhjI6h6oTWpHI","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":18,"nickName":"穆管理","openid":"oIuV2v7BbT3tAdRQF_MRsCOzCtJo","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":42,"nickName":"朱敏","openid":"o4kfOwkfXymGQuWbK1m_P6MpUTng","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":51,"nickName":"孔繁军","openid":"o4kfOwv52siMZwNU8r7QosdmqvoM","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":55,"nickName":"13600000008","openid":"oIuV2vxlUs7Blj2Ov79CUXfQjpDw","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":171,"nickName":"郭海英","openid":"o4kfOwvrWW0tbcFAUf3Atx3mp3Yo","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":null,"orderId":null,"flowtempname":null,"busistatdick":null,"permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":4530,"className":"FlowTempNode"}],{"id":5,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":"入库","businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":26,"name":"入库","msgTempId":"","operate":"transferIn26","permission":4,"flowNextStat":100,"flowStat":40,"repeatFlag":1,"sort":20,"annex":null,"nodeType":3,"flag":1,"isSendOa":null,"refuseFlag":1,"sendTodoMsgFlag":1,"nextNodeId":6,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":"入库","approvalType":1,"branchiids":null,"isTransmit":null,"optlogid":null,"operators":[{"userId":7,"nickName":"张福","openid":"oIuV2v77MaLCAQILhjI6h6oTWpHI","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":18,"nickName":"穆管理","openid":"oIuV2v7BbT3tAdRQF_MRsCOzCtJo","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":42,"nickName":"朱敏","openid":"o4kfOwkfXymGQuWbK1m_P6MpUTng","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":51,"nickName":"孔繁军","openid":"o4kfOwv52siMZwNU8r7QosdmqvoM","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":55,"nickName":"13600000008","openid":"oIuV2vxlUs7Blj2Ov79CUXfQjpDw","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":55,"nickName":"13600000008","openid":"oIuV2vxlUs7Blj2Ov79CUXfQjpDw","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}},{"userId":171,"nickName":"郭海英","openid":"o4kfOwvrWW0tbcFAUf3Atx3mp3Yo","createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":null,"authStatus":null,"accountId":null,"params":{}}],"logs":null,"orderId":null,"flowtempname":"采购订单","busistatdick":"","permissionname":"出入库","nowstatusname":null,"nextstatusname":null,"nextnodaname":"结束","nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"},{"id":6,"code":null,"orgId":null,"toOrgId":null,"deptId":null,"status":null,"condition":null,"createName":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"remark":"结束","businessType":null,"baseItems":null,"cusCtractId":null,"projectId":null,"projId":null,"supplierId":null,"fullName":null,"params":null,"busTable":null,"orgFlag":null,"flowtempId":26,"name":"结束","msgTempId":null,"operate":"end","permission":null,"flowNextStat":100,"flowStat":100,"repeatFlag":1,"sort":70,"annex":null,"nodeType":4,"flag":1,"isSendOa":null,"refuseFlag":null,"sendTodoMsgFlag":null,"nextNodeId":null,"timeLimit":null,"supervisor":null,"remindRule":null,"operation":"结束","approvalType":1,"branchiids":null,"isTransmit":null,"optlogid":null,"operators":[],"logs":null,"orderId":null,"flowtempname":"采购订单","busistatdick":"","permissionname":null,"nowstatusname":null,"nextstatusname":null,"nextnodaname":null,"nextnodecode":null,"nrulename":null,"flowTaskId":null,"className":"FlowTempNode"}]
        this.axios({
          method: 'get',
          url: '/prod-api/getNodes',
          params: {orderid: this.orderid, flowid: this.flowid}
        }).then(response => {
          if (response.data.code == 200) {
            this.loading = false;
            let data = response.data;
            this.$nextTick(function () {
              this.nodes = data.data;
              this.pendNodes = this.nodes.filter(item => {
                return item.status == 2;
              })
            });
          } else {
            this.loading = false;
            this.toastText('获取审批记录失败');
          }
        });
      },
      filterNull: function (obj) {
        return obj != null ? obj : {};
      },
    }
  }
</script>
